package com.wf.controller;

import com.wf.domain.ApartmentInfo;
import com.wf.dto.Apart_houses;
import com.wf.service.ApartmentInfoService;
import com.wf.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: zhiyu
 * @Date:9:04
 * @DESC:
 */
@Api("公寓信息控制层")
@RestController
@CrossOrigin
public class Apartment_infoController {
    @Autowired
    private ApartmentInfoService apartmentInfoService;
    @ApiOperation("添加合同模板信息")
    @PostMapping("/addConAllInfo")
    public Result addApartmentInfo(ApartmentInfo apartmentInfo){
        boolean save = apartmentInfoService.save(apartmentInfo);
        return Result.success(save);
    }
    @ApiOperation("查询公寓以及房屋信息")
    @GetMapping("/selectApartHouse")
    public Result selectApartHouse(){
        List<Apart_houses> apartHouses = apartmentInfoService.selectApartHouse();
        return Result.success(apartHouses);
    }
}
